<template >
    <a-button v-if="auditShipmentStatus == false" type="primary" size="mini" @click.stop="batchAddFee()" v-auth="props.auth"><icon-plus />批量</a-button>
    <batch-action-modal
    ref="batchActionRef"
    ></batch-action-modal>
</template>

<script setup lang="jsx">
import {computed, ref,inject,watch,reactive} from "vue";
import BatchActionModal from "@cps/actions/singleActionModalForFees.vue";
const batch = ref({visible: false,})
const batchActionRef = ref()
const parentCrudRef = inject('crudRef')
const getRecord = inject('getRecord',()=>{})
const record = inject('record',{})
const selected = ref([record?.value.id]);
const props = defineProps({
    auditShipmentStatus: {
        default: true
    },
    auth: {
        type: Array,
        default: []
    },
    title: {
        type: String,
        default: '添加费用'
    },
    api: {
        type: Function,
        default: ()=>{}
    },
})
const batchAddFee = () =>{
  batchActionRef.value.open({title: props.title, api:props.api,form:{
        form:{'invoices_type':''},
          submited:(data)=>{
            getRecord()
            parentCrudRef.value.refresh()
          }
      }})
}
defineExpose({batchAddFee})
</script>